package murcielago.phonema;

import java.util.Vector;

public class RegPhonema {

    public static String[] obtainTokens(String text){
        Vector tok = new Vector();
        RegEx reg = new RegEx(",.;-?!");
        String words[] = reg.split(text);

        for(int i = 0; i < words.length-1; i++){
            char letters[] = words[i].toCharArray();
            for(int j = 0; j < letters.length-1; i++){
                tok.addElement(String.valueOf(
                        new char[]{letters[j], letters[j+1]}));
            }
            if(letters.length == 0){
                tok.addElement(String.valueOf(letters[0]));
            }
            tok.addElement("pause");
        }

        String tokens[] = new String[tok.size()];
        for(int i = 0; i < tokens.length; i++){
            tokens[i] = String.valueOf(tok.elementAt(i));
        }

        return tokens;
    }

}
